<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.UserController"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-3.1.1.js"></script>
<script>
		$(document).ready(function(){
			$("#showList").click(function(){
				$.ajax({
					url:'userController.showList2.do',
					method:'post',
					success:function(e){
						alert(e);
					}
				});
			});
		}); 
</script>
</head>

<body>
	<fieldset>
		<legend> add </legend>
		<form action="userController.addUser.do" method="post">
			<table>
				<tr>
					<td>username</td>
					<td><input type="text" name="username" /></td>
				</tr>
				<tr>
					<td>password</td>
					<td><input type="password" name="password" /></td>
				</tr>
				<tr>
					<td colspan="2"><input type="submit" value="提交" /></td>
				</tr>
			</table>
		</form>
	</fieldset>

	<fieldset>
		<legend> update 使用User对象作为更新方法的参数</legend>
		<form action="userController.updateUser.do" method="post">
			<table>
				<tr>
					<td>ID</td>
					<td><input type="text" name="user.id" placeholder="user.id" /></td>
				</tr>
				<tr>
					<td>username</td>
					<td><input type="text" name="user.username" placeholder="user.username" /></td>
				</tr>
				<tr>
					<td>password</td>
					<td><input type="password" name="user.password" placeholder="user.password" /></td>
				</tr>
				<tr>
					<td colspan="2"><input type="submit" value="提交" /></td>
				</tr>
			</table>
		</form>
	</fieldset>
	<fieldset>
		<legend>拼接DataTables了使用的字符串</legend>
		<form action="userController.showList.do" method="post">
			<input type="submit" value="showList" />
		</form>
		<input type="button" id="showList" style="margin-top:10px" value="ajax alert" />
	</fieldset>
	
	<fieldset>
		<legend>File上传</legend>
		<form action="fileReciever.fileRec.do" method="post" enctype="multipart/form-data">
			<input type="file" name="file"/>
			<input type="submit" value="submit" />
		</form>
	</fieldset>
</body>
</html>